public class BiList {
    int key;
    BiList next;
    BiList previous;         //b

    BiList(int Item) {
        key = Item;
    }

    void add(int NewItem) {
        if (next == null) {
            next = new BiList(NewItem);
            next.previous = this;
        } else next.add(NewItem);
    }

    void print() {
        System.out.print(key + " ");
        if (next != null)
            next.print();
    }

}
